package com.miyu.system.controller.user;

import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.miyu.system.service.user.SysUserService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 系统用户控制器
 *
 * @author longm
 * @date 2022/10/03
 */
@RestController
@RequestMapping(value ="/sys-user")
public class SysUserController {

    @Resource
    private SysUserService service;

    @RequestMapping("saveSysUser")
    public JSONObject saveSysUser(@RequestBody  JSONObject sysUser){
        return service.saveSysUser(sysUser);
    }

    /**
     * 删除sys用户
     *
     * @param params 系统用户
     * @return {@link JSONObject}
     */
    @RequestMapping("deleteSysUser")
    public JSONObject deleteSysUser(@RequestBody JSONObject params){
        return service.deleteSysUser(params);
    }

    /**
     * 查询sys用户
     *
     * @param params 参数个数
     * @return {@link JSONArray}
     */
    @RequestMapping("querySysUser")
    public JSONArray querySysUser(@RequestBody JSONObject params) {
       return service.querySysUser(params);
    }



}
